<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>Excel | CatchAdmin 官网</title>
    <meta name="description" content="">
    <meta name="generator" content="VuePress 1.8.2">
    <style>a[title="站长统计"]{display:none}</style>
    <script data-ad-client="ca-pub-1505209242532150" async="true" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <script src="https://v1.cnzz.com/z_stat.php?id=1279921342&amp;web_id=1279921342"></script>
    <meta name="description" content="基于 Thinkphp & Vue 开发的后台管理框架">
    <meta name="keywords" content="catchadmin, 后台管理, 前后端分离, thinkphp后台管理框架, thinkphp前后端分离框架,php, elementui">
    <link rel="preload" href="/assets/css/0.styles.6834c255.css" as="style"><link rel="preload" href="/assets/js/app.d0396f44.js" as="script"><link rel="preload" href="/assets/js/2.1cef47df.js" as="script"><link rel="preload" href="/assets/js/12.95d2c383.js" as="script"><link rel="prefetch" href="/assets/js/10.483f2013.js"><link rel="prefetch" href="/assets/js/11.981d4461.js"><link rel="prefetch" href="/assets/js/13.061c2fe0.js"><link rel="prefetch" href="/assets/js/14.ec2753db.js"><link rel="prefetch" href="/assets/js/15.8ba1c321.js"><link rel="prefetch" href="/assets/js/16.f7f0d34c.js"><link rel="prefetch" href="/assets/js/17.aac0bf62.js"><link rel="prefetch" href="/assets/js/18.2e2fe306.js"><link rel="prefetch" href="/assets/js/19.aee304b3.js"><link rel="prefetch" href="/assets/js/20.86a73bc1.js"><link rel="prefetch" href="/assets/js/21.8992c972.js"><link rel="prefetch" href="/assets/js/22.0a78500a.js"><link rel="prefetch" href="/assets/js/23.06342909.js"><link rel="prefetch" href="/assets/js/24.06fd96a3.js"><link rel="prefetch" href="/assets/js/25.00664d4e.js"><link rel="prefetch" href="/assets/js/26.c3d4b548.js"><link rel="prefetch" href="/assets/js/27.3c6927ad.js"><link rel="prefetch" href="/assets/js/28.74498c0b.js"><link rel="prefetch" href="/assets/js/29.aae1a826.js"><link rel="prefetch" href="/assets/js/3.4d2bdca7.js"><link rel="prefetch" href="/assets/js/30.c7732a2c.js"><link rel="prefetch" href="/assets/js/31.20403043.js"><link rel="prefetch" href="/assets/js/32.7b8e9cfe.js"><link rel="prefetch" href="/assets/js/33.8610da11.js"><link rel="prefetch" href="/assets/js/4.d7b1015b.js"><link rel="prefetch" href="/assets/js/5.ff87de2e.js"><link rel="prefetch" href="/assets/js/6.0e91e688.js"><link rel="prefetch" href="/assets/js/7.ba30e213.js"><link rel="prefetch" href="/assets/js/8.35122549.js"><link rel="prefetch" href="/assets/js/9.081b18e5.js">
    <link rel="stylesheet" href="/assets/css/0.styles.6834c255.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="ant-row"><div class="sidebar-button"><i aria-label="icon: bars" class="anticon anticon-bars"><svg viewBox="0 0 1024 1024" focusable="false" data-icon="bars" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 1 0 112 0 56 56 0 1 0-112 0zm0 284a56 56 0 1 0 112 0 56 56 0 1 0-112 0zm0 284a56 56 0 1 0 112 0 56 56 0 1 0-112 0z"></path></svg></i> <span></span></div> <div class="ant-col ant-col-xs-24 ant-col-sm-24 ant-col-md-6 ant-col-lg-5 ant-col-xl-5 ant-col-xxl-4"><a href="/" class="router-link-active no-logo home-link"><!----> <span class="site-name">CatchAdmin 官网</span></a> <div class="search-box mobile-search"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div></div> <div class="ant-col ant-col-xs-0 ant-col-sm-0 ant-col-md-18 ant-col-lg-19 ant-col-xl-19 ant-col-xxl-20"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><ul role="menu" id="nav" class="ant-menu ant-menu-horizontal ant-menu-root ant-menu-light"><li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display:none;"><div aria-haspopup="true" class="ant-menu-submenu-title"><span>···</span><i class="ant-menu-submenu-arrow"></i></div></li><li role="menuitem" class="ant-menu-item"><a href="/" class="router-link-active">
          🏠首页
        </a></li><li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display:none;"><div aria-haspopup="true" class="ant-menu-submenu-title"><span>···</span><i class="ant-menu-submenu-arrow"></i></div></li><li role="menuitem" class="ant-menu-item ant-menu-item-selected"><a href="/docs/" class="router-link-active">
          📖文档
        </a></li><li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display:none;"><div aria-haspopup="true" class="ant-menu-submenu-title"><span>···</span><i class="ant-menu-submenu-arrow"></i></div></li><li role="menuitem" class="ant-menu-item"><a href="/laravel/">
          📖Laravel
        </a></li><li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display:none;"><div aria-haspopup="true" class="ant-menu-submenu-title"><span>···</span><i class="ant-menu-submenu-arrow"></i></div></li><li role="menuitem" class="ant-menu-item"><a href="/faq/">
          🤔FAQ
        </a></li><li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display:none;"><div aria-haspopup="true" class="ant-menu-submenu-title"><span>···</span><i class="ant-menu-submenu-arrow"></i></div></li><li role="menuitem" class="ant-menu-item"><a href="/donate/">
          🎉赞助名单
        </a></li><li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="display:none;"><div aria-haspopup="true" class="ant-menu-submenu-title"><span>···</span><i class="ant-menu-submenu-arrow"></i></div></li><li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal"><div aria-haspopup="true" class="ant-menu-submenu-title"><span>
          🚀仓库地址
        </span><i class="ant-menu-submenu-arrow"></i></div></li><li role="menuitem" class="ant-menu-submenu ant-menu-submenu-horizontal ant-menu-overflowed-submenu" style="visibility:hidden;position:absolute;"><div aria-haspopup="true" class="ant-menu-submenu-title"><span>···</span><i class="ant-menu-submenu-arrow"></i></div></li></ul> <!----></nav></div></div> <!----></header> <aside class="sidebar"><div><div class="ads"><div id="ads_1"><img src="https://cover.kancloud.cn/akasishikelu/thinkphp6!middle"> <span title="基于 catchadmin 的 Thinkphp 6.0 企业级后台管理开发&amp;源码分析">基于 catchadmin 的 Thinkphp 6.0 企业级后台管理开发&amp;源码分析</span></div></div> <div role="separator" id="reset-margin" class="ant-divider ant-divider-horizontal ant-divider-dashed"></div></div> <ul class="sidebar-links"><li><a href="/docs/" aria-current="page" title="项目介绍" class="sidebar-link">项目介绍</a></li><li><a href="/docs/install.html" title="项目安装" class="sidebar-link">项目安装</a></li><li><a href="/docs/project-introduce.html" title="目录结构" class="sidebar-link">目录结构</a></li><li><a href="/docs/console.html" title="命令介绍" class="sidebar-link">命令介绍</a></li><li><a href="/docs/request.html" title="请求介绍" class="sidebar-link">请求介绍</a></li><li><a href="/docs/model.html" title="模型介绍" class="sidebar-link">模型介绍</a></li><li><a href="/docs/dataScope.html" title="权限介绍" class="sidebar-link">权限介绍</a></li><li><a href="/docs/extend.html" title="项目扩展" class="sidebar-link">项目扩展</a></li><li><a href="/docs/http.html" title="Http客户端" class="sidebar-link">Http客户端</a></li><li><a href="/docs/excel.html" aria-current="page" title="Excel" class="active sidebar-link">Excel</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/excel.html#excel" title="Excel" class="sidebar-link">Excel</a></li><li class="sidebar-sub-header"><a href="/docs/excel.html#导出" title="导出" class="sidebar-link">导出</a></li><li class="sidebar-sub-header"><a href="/docs/excel.html#设置对应的数据值" title="设置对应的数据值" class="sidebar-link">设置对应的数据值</a></li><li class="sidebar-sub-header"><a href="/docs/excel.html#设置标题" title="设置标题" class="sidebar-link">设置标题</a></li><li class="sidebar-sub-header"><a href="/docs/excel.html#设置开始列" title="设置开始列" class="sidebar-link">设置开始列</a></li><li class="sidebar-sub-header"><a href="/docs/excel.html#设置行" title="设置行" class="sidebar-link">设置行</a></li><li class="sidebar-sub-header"><a href="/docs/excel.html#设置对应列的宽度" title="设置对应列的宽度" class="sidebar-link">设置对应列的宽度</a></li><li class="sidebar-sub-header"><a href="/docs/excel.html#获取活动的列" title="获取活动的列" class="sidebar-link">获取活动的列</a></li><li class="sidebar-sub-header"><a href="/docs/excel.html#before-处理" title="before 处理" class="sidebar-link">before 处理</a></li><li class="sidebar-sub-header"><a href="/docs/excel.html#内存溢出" title="内存溢出" class="sidebar-link">内存溢出</a></li><li class="sidebar-sub-header"><a href="/docs/excel.html#导出-2" title="导出" class="sidebar-link">导出</a></li><li class="sidebar-sub-header"><a href="/docs/excel.html#新增模型导出" title="新增模型导出" class="sidebar-link">新增模型导出</a></li></ul></li><li><a href="/docs/sensitiveWord.html" title="敏感词" class="sidebar-link">敏感词</a></li><li><a href="/docs/crontab.html" title="定时任务新版" class="sidebar-link">定时任务新版</a></li><li><a href="/docs/catch-table.html" title="表格组件" class="sidebar-link">表格组件</a></li><li><a href="/docs/front.html" title="前端开发" class="sidebar-link">前端开发</a></li></ul></aside> <main class="page"> <div class="theme-antdocs-content content__default"><h2 id="excel"><a href="#excel" class="header-anchor">#</a> Excel</h2> <h2 id="导出"><a href="#导出" class="header-anchor">#</a> 导出</h2> <div class="custom-block tip"><p class="custom-block-title">TIP</p> <p><code>CatchAdmin</code> 提供一套简单易使用的导出工具，可以轻松完成导出功能，只需要简单的实现。便能完成。下面来看一下如何使用吧。</p></div> <p>来看一个简单的例子，导出 <code>Users</code> 表的数据</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">namespace</span> <span class="token package">catcher<span class="token punctuation">\</span>library<span class="token punctuation">\</span>excel</span><span class="token punctuation">;</span>

<span class="token keyword">use</span> <span class="token package">think<span class="token punctuation">\</span>facade<span class="token punctuation">\</span>Db</span><span class="token punctuation">;</span>

<span class="token keyword">class</span> <span class="token class-name">Users</span> <span class="token keyword">implements</span> <span class="token class-name">ExcelContract</span>
<span class="token punctuation">{</span>
    <span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function">headers</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword return-type">array</span>
    <span class="token punctuation">{</span>
        <span class="token comment">// TODO: Implement headers() method.</span>
        <span class="token keyword">return</span> <span class="token punctuation">[</span>
            <span class="token string single-quoted-string">'用户名'</span><span class="token punctuation">,</span> <span class="token string single-quoted-string">'邮箱'</span>
        <span class="token punctuation">]</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function">sheets</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token punctuation">{</span>
        <span class="token comment">// TODO: Implement sheets() method.</span>
        <span class="token keyword">return</span> <span class="token class-name static-context">Db</span><span class="token operator">::</span><span class="token function">name</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'user'</span><span class="token punctuation">)</span><span class="token operator">-&gt;</span><span class="token function">field</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string single-quoted-string">'username'</span><span class="token punctuation">,</span> <span class="token string single-quoted-string">'email'</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token operator">-&gt;</span><span class="token function">limit</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">)</span><span class="token operator">-&gt;</span><span class="token function">cursor</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>

</code></pre></div><p>首先你要实现的 <code>catcher\library\excel\ExcelContract</code> 接口，只需要实现两个方法</p> <ul><li>headers
<ul><li><code>headers</code> 方法用于设置 excel 头部栏目显示的数据名称</li></ul></li> <li>sheets
<ul><li><code>sheets</code> 方法用于查询处理数据</li></ul></li></ul> <p>除了接口必须实现的方法外，还提供了其他可用的方法</p> <h2 id="设置对应的数据值"><a href="#设置对应的数据值" class="header-anchor">#</a> 设置对应的数据值</h2> <p>示例的数据只有两个字段 <code>username</code> 和 <code>email</code>, 一一对应<code>用户名</code>和<code>邮箱</code>。如果查询是这样的话.</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token class-name static-context">Db</span><span class="token operator">::</span><span class="token function">name</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'user'</span><span class="token punctuation">)</span><span class="token operator">-&gt;</span><span class="token function">field</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string single-quoted-string">'email'</span><span class="token punctuation">,</span> <span class="token string single-quoted-string">'username'</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token operator">-&gt;</span><span class="token function">limit</span><span class="token punctuation">(</span><span class="token number">100</span><span class="token punctuation">)</span><span class="token operator">-&gt;</span><span class="token function">cursor</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><p>那么数据就会是相反的，不会一一对应其设置的 <code>headers</code>,所以此时提供了新的方法。</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function">keys</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword return-type">array</span>
<span class="token punctuation">{</span>
    <span class="token comment">// TODO: Implement keys() method.</span>
    <span class="token keyword">return</span> <span class="token punctuation">[</span>
        <span class="token string single-quoted-string">'username'</span><span class="token punctuation">,</span> <span class="token string single-quoted-string">'email'</span>
    <span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="设置标题"><a href="#设置标题" class="header-anchor">#</a> 设置标题</h2> <p>有时候需要在 <code>excel</code> 顶部设置标题，可以使用 <code>setTitle</code> 方法</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function">setTitle</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token punctuation">[</span>
        <span class="token string single-quoted-string">'A1:G1'</span><span class="token punctuation">,</span> <span class="token string single-quoted-string">'测试'</span><span class="token punctuation">,</span> <span class="token class-name static-context">Alignment</span><span class="token operator">::</span><span class="token constant">HORIZONTAL_CENTER</span>
    <span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><p>返回的一个数组</p> <ul><li>第一个元素 占用的列</li> <li>第二个元素 标题</li> <li>第三个元素 位置（使用<code>PhpOffice\PhpSpreadsheet\Style\Alignment</code>提供的位置常量设置）</li></ul> <h2 id="设置开始列"><a href="#设置开始列" class="header-anchor">#</a> 设置开始列</h2> <p>如果开始列不是从 <code>A</code> 列开始的话，可以通过该方法进行设置</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function">start</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token string single-quoted-string">'B'</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="设置行"><a href="#设置行" class="header-anchor">#</a> 设置行</h2> <p>如果你设置了 <code>title</code>，那么一定需要设置开始行了。因为默认是从 <code>A1</code>,所以有必要进行开始行的设置。</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function">setRow</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token number">2</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="设置对应列的宽度"><a href="#设置对应列的宽度" class="header-anchor">#</a> 设置对应列的宽度</h2> <p>如果你需要设置列的宽度，那么可以用<code>setWidth</code>方法进行设置</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function">setWidth</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token punctuation">[</span>
        <span class="token string single-quoted-string">'A'</span> <span class="token operator">=&gt;</span> <span class="token number">50</span><span class="token punctuation">,</span>
    <span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="获取活动的列"><a href="#获取活动的列" class="header-anchor">#</a> 获取活动的列</h2> <p>如果你需要一些自定义列的需求，那么可以通过该方法<code>getWorksheet</code>获取当前激活的 <code>sheet</code> 来处理</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function">getWorksheet</span><span class="token punctuation">(</span><span class="token variable">$sheet</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token variable">$sheet</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="before-处理"><a href="#before-处理" class="header-anchor">#</a> before 处理</h2> <p>获取当前活动列之后，通过该方法你就可以自定义处理数据前的准备工作</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function">before</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    <span class="token comment">// todo</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="内存溢出"><a href="#内存溢出" class="header-anchor">#</a> 内存溢出</h2> <p>如果是因为数据量太大，导致内存溢出。提供了 <code>memory</code> 属性设置运行时所需内存。</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token keyword">public</span> <span class="token variable">$memory</span> <span class="token operator">=</span> <span class="token string single-quoted-string">'1024M'</span><span class="token punctuation">;</span>
</code></pre></div><h2 id="导出-2"><a href="#导出-2" class="header-anchor">#</a> 导出</h2> <p>当上面全部准备好之后，就可以开始使用导出了</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name class-name-fully-qualified">catcher<span class="token punctuation">\</span>library<span class="token punctuation">\</span>excel<span class="token punctuation">\</span>Excel</span><span class="token punctuation">)</span><span class="token operator">-&gt;</span><span class="token function">save</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Users</span><span class="token punctuation">,</span> <span class="token string single-quoted-string">'excel 导出的地址'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><h2 id="新增模型导出"><a href="#新增模型导出" class="header-anchor">#</a> 新增模型导出</h2> <p>注意模型导出提供的功能很有限，适用于简单导出，如果你需要更加完善的导出，还是按照上面的文档来，提供一个导出用户例子</p> <div class="language-php extra-class"><pre class="language-php"><code><span class="token class-name static-context">Users</span><span class="token operator">::</span><span class="token function">field</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string single-quoted-string">'id'</span><span class="token punctuation">,</span> <span class="token string single-quoted-string">'username'</span><span class="token punctuation">,</span> <span class="token string single-quoted-string">'email'</span><span class="token punctuation">,</span> <span class="token string single-quoted-string">'status'</span><span class="token punctuation">,</span> <span class="token string single-quoted-string">'created_at'</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token operator">-&gt;</span><span class="token function">select</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
                <span class="token operator">-&gt;</span><span class="token function">each</span><span class="token punctuation">(</span><span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token operator">&amp;</span><span class="token variable">$item</span><span class="token punctuation">,</span> <span class="token variable">$key</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
                    <span class="token variable">$item</span><span class="token operator">-&gt;</span><span class="token property">status</span> <span class="token operator">=</span> <span class="token variable">$item</span><span class="token operator">-&gt;</span><span class="token property">status</span> <span class="token operator">==</span> <span class="token class-name static-context">Users</span><span class="token operator">::</span><span class="token constant">ENABLE</span> <span class="token operator">?</span> <span class="token string single-quoted-string">'启用'</span> <span class="token punctuation">:</span> <span class="token string single-quoted-string">'停用'</span><span class="token punctuation">;</span>
                <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token operator">-&gt;</span><span class="token function">export</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string single-quoted-string">'id'</span><span class="token punctuation">,</span> <span class="token string single-quoted-string">'用户名'</span><span class="token punctuation">,</span> <span class="token string single-quoted-string">'邮箱'</span><span class="token punctuation">,</span> <span class="token string single-quoted-string">'状态'</span><span class="token punctuation">,</span> <span class="token string single-quoted-string">'创建日期'</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
</code></pre></div></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/catch-admin/document/edit/master/docs/docs/excel.md" target="_blank" rel="noopener noreferrer">在 Github 编辑此页</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <div class="last-updated"><span class="prefix">更新时间:</span> <span class="time">11/23/2020, 6:16:27 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev"><a href="/docs/http.html" class="prev"><i aria-label="icon: left" class="anticon anticon-left"><svg viewBox="64 64 896 896" focusable="false" data-icon="left" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"></path></svg></i>
        Http客户端
      </a></span> <span class="next"><a href="/docs/sensitiveWord.html">
        敏感词
        <i aria-label="icon: right" class="anticon anticon-right"><svg viewBox="64 64 896 896" focusable="false" data-icon="right" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z"></path></svg></i></a></span></p></div> </main> <!----></div><div class="global-ui"></div></div>
    <script src="/assets/js/app.d0396f44.js" defer></script><script src="/assets/js/2.1cef47df.js" defer></script><script src="/assets/js/12.95d2c383.js" defer></script>
  </body>
</html>